Skip to content

fix A325_generator_diamond on openmc >= 0.15.3 for reference_uvw=(1, 0, 0) - #95

Merged
SteSeg merged 1 commit into
LIBRA-project:mainfrom
steps-re:fix/openmc-reference-uvw
Oct 5, 2026
Merged

SteSeg merged 1 commit into
LIBRA-project:mainfrom
steps-re:fix/openmc-reference-uvw

Conversation

@steps-re

@steps-re steps-re commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

on openmc 0.15.3+, A325_generator_diamond(..., (1, 0, 0)) raises "reference v direction must not be parallel to reference u direction". that's what's failing CI on LIBRA-project/BABY-1L-run-4#26 (@davidepettinari if you already have a fix I'll close this). #89 uses (1, 0, 0) too.

cause is openmc-dev/openmc#3582, which added reference_vwu to PolarAzimuthal with a default of (1, 0, 0).

this only passes an orthogonal reference_vwu when the beam axis is along x, so other axes are untouched. phi is uniform so the x-axis source matches 0.15.0 statistically. a zero/nan axis now raises a ValueError.

tests sample 20k particles to check the angle distribution, and check the other axes are unchanged. full suite passes on 0.15.0, 0.15.3 and 0.16.0 except test_get_peaks[NaI-nuclide4-0.1], which fails now and then on main too (unseeded noise).

the run repos will need a new release to pick this up. pinning openmc<0.15.3 should unblock run-4#26 for now.

(AI-assisted)

…, 0, 0)

OpenMC 0.15.3 added reference_vwu to PolarAzimuthal, defaulting to
(1, 0, 0). A reference_uvw parallel to it raises a ValueError (openmc
#3582), so a beam along x could not be built.

reference_vwu is now passed only when reference_uvw is parallel to x,
using an orthogonal unit vector. Every other axis keeps OpenMC's
default and gives the same particles as before. A zero or non-finite
reference_uvw raises a clear ValueError.

Tests cover each beam axis including (1, 0, 1), check that unaffected
axes match OpenMC's own default, and check invalid directions raise.

@RemDelaporteMathurin RemDelaporteMathurin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm happy with this, @SteSeg @davidepettinari do you mind giving this a look?

@SteSeg
SteSeg merged commit 0439a89 into LIBRA-project:main Oct 5, 2026
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants